<template>
  <view class="login-page">
    <view class="login-layout">
      <view class="login-title"> 登录 </view>
      <view class="login-input">
        <text class="iconfont start-icon icon-weibiaoti--6"></text>
        <input
          class="uni-input"
          placeholder="请输入账号"
          v-model="username"
          placeholder-class="placeholder-style"
        />
        <text
          class="iconfont end-icon icon-weibiaoti--13"
          @click="clearUsername"
        ></text>
      </view>
      <view class="login-input">
        <text class="iconfont start-icon icon-weibiaoti--27"></text>
        <input
          class="uni-input"
          placeholder="请输入密码"
          :password="showPassword"
          v-model="password"
          placeholder-class="placeholder-style"
        />
        <text
          class="iconfont end-icon icon-weibiaoti--34"
          @click="showPassword = !showPassword"
        ></text>
      </view>

      <view class="login-button" @click="loginFn">登录</view>
      <view class="other-login">
        <view class="icon-text">
          <hr />
          <text>其他登录方式</text>
          <hr />
        </view>
        <view class="login-icon">
          <view class="icon-image">
            <image src="/static/icon/qq.png"></image>
          </view>
          <view class="icon-image">
            <image src="/static/icon/weixin.png"></image>
          </view>
          <view class="icon-image">
            <image src="/static/icon/shouji.png"></image>
          </view>
        </view>
      </view>

      <view class="register">
        <text>忘记密码</text>
        <text class="register-text">注册</text>
      </view>
    </view>
  </view>
</template>

<script>
import { defineComponent } from "vue";
import { useMixin } from "./mixins";
export default defineComponent({
  name: "login002",
  props: {},
  components: {},
  setup() {
    const mixin = useMixin();
    return {
      ...mixin,
    };
  },
});
</script>
<style scoped lang="less">
.login-page {
  width: 100%;
  height: 100vh;
  //   背景色倾斜渐变
  background: linear-gradient(to right top, #692bdd, #692bdd, #048ad1);
  .login-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    .login-title {
      font-size: 50rpx;
      margin-top: 200rpx;
      color: #fff;
    }
    .login-input {
      width: 600rpx;
      position: relative;
      margin-top: 70rpx;
      .uni-input {
        border-bottom: 1rpx solid #eeeeee;
        height: 80rpx;
        line-height: 80rpx;
        padding: 0 60rpx;
        box-sizing: border-box;
        color: #fff;
        //   placeholder样式修改
        .placeholder-style {
          color: #fff;
          font-size: 24rpx;
        }
      }
      .start-icon {
        font-size: 40rpx;
        position: absolute;
        left: 0;
        color: #fff;
        top: 50%;
        transform: translateY(-50%);
      }
      .end-icon {
        font-size: 30rpx;
        position: absolute;
        color: #eee;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
      }
    }
    .login-button {
      width: 600rpx;
      background: #fff;
      height: 100rpx;
      line-height: 100rpx;
      text-align: center;
      border-radius: 50rpx;
      // 内阴影
      background: linear-gradient(to top, #d6c1ff, #ffffff);
      color: #692bdd;
      font-size: 30rpx;
      margin-top: 80rpx;
      transition: all 0.3s;
      &:active {
        background: #fff;
      }
    }
    .other-login {
      width: 400rpx;
      box-sizing: border-box;
      margin-top: 80rpx;
      .icon-text {
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: #fff;
        padding: 0 10rpx;
        box-sizing: border-box;
        hr {
          height: 0.5rpx;
          width: 80rpx;
          margin: 0;
          padding: 0;
        }
        // 横向
      }
      .login-icon {
        margin-top: 50rpx;
        display: flex;
        justify-content: space-between;
        .icon-image {
          width: 60rpx;
          height: 60rpx;
          padding: 10rpx;
          background: #fff;
          border-radius: 50%;
          image {
            width: 100%;
            height: 100%;
          }
        }
      }
    }
  }

  .register {
    display: flex;
    justify-content: space-between;
    position: fixed;
    bottom: 0;
    height: 80rpx;
    width: 80%;
    line-height: 80rpx;
    color: #fff;
    border-top: 1rpx solid #fff;
  }
}
</style>
